/*
 * lcd.h
 *
 *  Created on: Jun 15, 2011
 *      Author: ben
 */

#ifndef LCD_H_
#define LCD_H_

//LCD Write Commands
void onWriteChar(char data);
void onWriteString(char *data);
void onWriteDouble(double data);
void onWriteCmd(char data);
void onWriteStatus(char *data);
int onWriteStatusPrintF(char data, FILE *stream);

// LCD Navigation Commands
void onMainMenu();
void onGPSMenu();
void onSetLCDLatitude(double lat, char NS);
void onSetLCDLongitude(double lon, char EW);
void onLoadingScreen(void);
void onLoadingScreenBar(void);
void onTempMenu(void);
void onCarMenu(void);
void onAmpMenu(void);
void onMainMore(void);
void onMainConf(void);
void onGPSMore(void);
void onAmpMore(void);

// LCD Control Commands
void onClearScreen();
void onSetX(char x_spot);
void onSetY(char y_spot);
void onSetXY(char x_spot, char y_spot);
void onDrawLine(char x1, char y1, char x2, char y2);
void onDrawBox(char x1, char y1, char x2, char y2);
void onClearLine(char y_coord);
void onClearArea(char x1, char y1, char x2, char y2);
void onClearStatus(void);
void onDrawStatusBox(void);
void onDrawLoadingBar(void);
void onUpdateLoadingBar(int percent);
void onSetPixel(char x, char y);

//Command Defines
#define CTL				0x7c
#define CLR				0x00
#define REVER			0x12
#define BACK_LIGHT		0x02
#define SET_BAUD		0x07
#define SET_X			0x18
#define SET_Y			0x19
#define SET_PX			0x10
#define DRAW_LINE		0x0c
#define DRAW_CIRCLE 	0x03
#define DRAW_BOX		0x0f
#define ERASE_BLOCK		0x05

//LCD Character Length
#define CHAR_LENGTH		0x07
#define CHAR_HEIGHT		0x08
#define MAX_CHAR_LEN	0x15

//Location Definitions
#define X_MIDDLE		0x40
#define X_MAX			0x80
#define Y_MIDDLE		0x20
#define Y_MAX			0x40 - CHAR_HEIGHT
#define TOP				Y_MAX
#define BOTTOM			0x00 + CHAR_HEIGHT
#define LEFT			0x00
#define RIGHT			X_MAX


#endif /* LCD_H_ */
